home *** CD-ROM | disk | FTP | other *** search
/ 3D Games - Real-time Rend…ng & Software Technology / 3D Games - Real-time Rendering & Software Technology.iso / flysdk / util / flyPlugin / flypluginAw.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-02-26  |  3.7 KB  |  121 lines

  1. // flypluginaw.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "flyplugin.h"
  6. #include "flypluginaw.h"
  7. #include "chooser.h"
  8. #include <COMDEF.H>
  9.  
  10. #ifdef _PSEUDO_DEBUG
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. // This is called immediately after the custom AppWizard is loaded.  Initialize
  16. //  the state of the custom AppWizard here.
  17. void CFlypluginAppWiz::InitCustomAppWiz()
  18. {
  19.     Flypluginaw.m_Dictionary["PROJTYPE_DLL"]="1";
  20.  
  21.     // Create a new dialog chooser; CDialogChooser's constructor initializes
  22.     //  its internal array with pointers to the steps.
  23.     m_pChooser = new CDialogChooser;
  24.  
  25.     // Set the maximum number of steps.
  26.     SetNumberOfSteps(LAST_DLG);
  27. }
  28.  
  29. // This is called just before the custom AppWizard is unloaded.
  30. void CFlypluginAppWiz::ExitCustomAppWiz()
  31. {
  32.     // Deallocate memory used for the dialog chooser
  33.     ASSERT(m_pChooser != NULL);
  34.     delete m_pChooser;
  35.     m_pChooser = NULL;
  36.  
  37.     // TODO: Add code here to deallocate resources used by the custom AppWizard
  38. }
  39.  
  40. // This is called when the user clicks "Create..." on the New Project dialog
  41. //  or "Next" on one of the custom AppWizard's steps.
  42. CAppWizStepDlg* CFlypluginAppWiz::Next(CAppWizStepDlg* pDlg)
  43. {
  44.     // Delegate to the dialog chooser
  45.     return m_pChooser->Next(pDlg);
  46. }
  47.  
  48. // This is called when the user clicks "Back" on one of the custom
  49. //  AppWizard's steps.
  50. CAppWizStepDlg* CFlypluginAppWiz::Back(CAppWizStepDlg* pDlg)
  51. {
  52.     // Delegate to the dialog chooser
  53.     return m_pChooser->Back(pDlg);
  54. }
  55.  
  56. void CFlypluginAppWiz::CustomizeProject(IBuildProject* pProject)
  57. {
  58.     long i,j;
  59.     char str[256];
  60.     _bstr_t tool1("cl.exe"),tool2("link.exe");
  61.  
  62.     IConfigurations *confs;
  63.     IConfiguration *conf;
  64.  
  65.     pProject->get_Configurations(&confs);
  66.     confs->get_Count(&i);
  67.  
  68.     for( j=0;j<i;j++ )
  69.     {
  70.         VARIANT v;
  71.         v.vt=VT_I4;
  72.         v.lVal=j+1;
  73.         conf=0;
  74.         confs->Item(v,&conf);
  75.         if (conf)
  76.             {
  77.             sprintf(str,"/I %s",Flypluginaw.m_Dictionary["FLYSDKPATH"]);
  78.             strcat(str,"lib");
  79.             _bstr_t cmnd1(str);
  80.             conf->AddToolSettings((wchar_t *)tool1,(wchar_t *)cmnd1,v);
  81.  
  82.             sprintf(str,"/libpath:%s",Flypluginaw.m_Dictionary["FLYSDKPATH"]);
  83.             strcat(str,"lib");
  84.             _bstr_t cmnd2(str);
  85.             conf->AddToolSettings((wchar_t *)tool2,(wchar_t *)cmnd2,v);
  86.  
  87.             strcpy(str,"Fly3D.lib OpenGL32.lib glu32.lib dxguid.lib ddraw.lib dinput.lib dsound.lib dplayx.lib winmm.lib gdi32.lib ole32.lib user32.lib");
  88.             _bstr_t cmnd3(str);
  89.             conf->AddToolSettings((wchar_t *)tool2,(wchar_t *)cmnd3,v);
  90.             
  91.             conf->Release();
  92.             }
  93.     }
  94.  
  95.     confs->Release();
  96.  
  97.     // TODO: Add code here to customize the project.  If you don't wish
  98.     //  to customize project, you may remove this virtual override.
  99.     
  100.     // This is called immediately after the default Debug and Release
  101.     //  configurations have been created for each platform.  You may customize
  102.     //  existing configurations on this project by using the methods
  103.     //  of IBuildProject and IConfiguration such as AddToolSettings,
  104.     //  RemoveToolSettings, and AddCustomBuildStep. These are documented in
  105.     //  the Developer Studio object model documentation.
  106.  
  107.     // WARNING!!  IBuildProject and all interfaces you can get from it are OLE
  108.     //  COM interfaces.  You must be careful to release all new interfaces
  109.     //  you acquire.  In accordance with the standard rules of COM, you must
  110.     //  NOT release pProject, unless you explicitly AddRef it, since pProject
  111.     //  is passed as an "in" parameter to this function.  See the documentation
  112.     //  on CCustomAppWiz::CustomizeProject for more information.
  113. }
  114.  
  115.  
  116. // Here we define one instance of the CFlypluginAppWiz class.  You can access
  117. //  m_Dictionary and any other public members of this class through the
  118. //  global Flypluginaw.
  119. CFlypluginAppWiz Flypluginaw;
  120.  
  121.